<?
require("config.php");

$menutype = 2;

if (NULL!=$action){

	$dir = $table . "/";

	myUpload($Photo01,$Photo01_name,$dir);
	myUpload($Photo02,$Photo02_name,$dir);
	myUpload($Photo03,$Photo03_name,$dir);
	myUpload($Photo04,$Photo04_name,$dir);
	myUpload($Photo05,$Photo05_name,$dir);
	myUpload($Photo06,$Photo06_name,$dir);
	myUpload($Photo07,$Photo07_name,$dir);
	myUpload($Photo08,$Photo08_name,$dir);
	myUpload($Photo09,$Photo09_name,$dir);
	myUpload($Photo10,$Photo10_name,$dir);

	if ($Photo01_name == null) $Photo01_name = $bk_Photo01;
	if ($Photo02_name == null) $Photo02_name = $bk_Photo02;
	if ($Photo03_name == null) $Photo03_name = $bk_Photo03;
	if ($Photo04_name == null) $Photo04_name = $bk_Photo04;
	if ($Photo05_name == null) $Photo05_name = $bk_Photo05;
	if ($Photo06_name == null) $Photo06_name = $bk_Photo06;
	if ($Photo07_name == null) $Photo07_name = $bk_Photo07;
	if ($Photo08_name == null) $Photo08_name = $bk_Photo08;
	if ($Photo09_name == null) $Photo09_name = $bk_Photo09;
	if ($Photo10_name == null) $Photo10_name = $bk_Photo10;

   $field = array(
		"item01_packaging_text",
		"item02_packaging_text",
		"item03_packaging_text",
		"item04_packaging_text",
		"item05_packaging_text",
		"item06_packaging_text",
		"item07_packaging_text",
		"item08_packaging_text", 
		"item09_packaging_text",
		"item10_packaging_text",
		"item01_packaging_photo",
		"item02_packaging_photo",
		"item03_packaging_photo",
		"item04_packaging_photo",
		"item05_packaging_photo",
		"item06_packaging_photo",
		"item07_packaging_photo",
		"item08_packaging_photo", 
		"item09_packaging_photo",
		"item10_packaging_photo",
	);


   $content = array(
		$Text01,
		$Text02,
		$Text03,
		$Text04,
		$Text05,
		$Text06,
		$Text07,
		$Text08,
		$Text09,
		$Text10,
		$Photo01_name,
		$Photo02_name,
		$Photo03_name,
		$Photo04_name,
		$Photo05_name,
		$Photo06_name,
		$Photo07_name,
		$Photo08_name,
		$Photo09_name,
	    $Photo10_name,
	);

   $expression = "code = '$Code'";

   myUpdate($table,$field,$content,$expression);



   header("location:" . $rela_path . "share/msg.php?v=1");

   exit();

}


if (!checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9002");
  
}

$Query = "select 
item01_packaging_text,
item02_packaging_text,
item03_packaging_text,
item04_packaging_text,
item05_packaging_text,
item06_packaging_text,
item07_packaging_text,
item08_packaging_text, 
item09_packaging_text,
item10_packaging_text,
item01_packaging_photo,
item02_packaging_photo,
item03_packaging_photo,
item04_packaging_photo,
item05_packaging_photo,
item06_packaging_photo,
item07_packaging_photo,
item08_packaging_photo, 
item09_packaging_photo,
item10_packaging_photo 
from pro_basic where code='$Code' Limit 1";
$r = myQuery($Query);

$Text01= $r[0][0];
$Text02= $r[0][1];
$Text03= $r[0][2];
$Text04= $r[0][3];
$Text05= $r[0][4];
$Text06= $r[0][5];
$Text07= $r[0][6];
$Text08= $r[0][7];
$Text09= $r[0][8];
$Text10= $r[0][9];
$Photo01= $r[0][10];
$Photo02= $r[0][11];
$Photo03= $r[0][12];
$Photo04= $r[0][13];
$Photo05= $r[0][14];
$Photo06= $r[0][15];
$Photo07= $r[0][16];
$Photo08= $r[0][17];
$Photo09= $r[0][18];
$Photo10= $r[0][19];

require($rela_path . "inc/header.php");

?>
<!--Content Start-->
<form action="" method="post" enctype="multipart/form-data" name="form1">

<!--hidden filed-->
<input name="action" type="hidden" value="edit">
<input name="Code" type="hidden" value="<?print($Code)?>">

<input name="bk_Photo01" type="hidden" value="<?print($Photo01)?>">
<input name="bk_Photo02" type="hidden" value="<?print($Photo02)?>">
<input name="bk_Photo03" type="hidden" value="<?print($Photo03)?>">
<input name="bk_Photo04" type="hidden" value="<?print($Photo04)?>">
<input name="bk_Photo05" type="hidden" value="<?print($Photo05)?>">
<input name="bk_Photo06" type="hidden" value="<?print($Photo06)?>">
<input name="bk_Photo07" type="hidden" value="<?print($Photo07)?>">
<input name="bk_Photo08" type="hidden" value="<?print($Photo08)?>">
<input name="bk_Photo09" type="hidden" value="<?print($Photo09)?>">
<input name="bk_Photo10" type="hidden" value="<?print($Photo10)?>">




                    <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td align="right">


	  <input type="image" src="../../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('../product_menu.php',1);return false;"> 
        <input type="image" src="../../../images/bt_save.gif" width="76" height="22"> 



      </td>
                      </tr>
                    </table>
                    <table width="95%" border="0" align="center">
                      <tr> 
                        <td align="right">&nbsp; </td>
                      </tr>
                      <tr> 
                        
      <td>
	  
	  
<table border="0" cellspacing="0" cellpadding="2">
          <tr> 
            <td>Text 01 </td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text01" cols="45" rows="8"><?print($Text01)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo01" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 02</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text02" cols="45" rows="8"><?print($Text02)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo02" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 03</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text03" cols="45" rows="8"><?print($Text03)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo03" size="45"> 
            </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 04</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text04" cols="45" rows="8"><?print($Text04)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo04" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 05</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text05" cols="45" rows="8"><?print($Text05)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo05" size="45"> 
            </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 06</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text06" cols="45" rows="8"><?print($Text06)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo06" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 07</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text07" cols="45" rows="8"><?print($Text07)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo07" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 08</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text08" cols="45" rows="8"><?print($Text08)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo08" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 09</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text09" cols="45" rows="8"><?print($Text09)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo09" size="45"> 
            </td>
          </tr>
          <tr> 
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>Text 10 </td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td align="right">(Text)</td>
            <td> <textarea class="text" name="Text10" cols="45" rows="8"><?print($Text10)?></textarea> 
            </td>
          </tr>
          <tr> 
            <td align="right">(Photo)</td>
            <td> <input type="file" class="text" name="Photo10" size="45"> 
            </td>
          </tr>
        </table>
		
		
		</td>
                      </tr>
                    </table>
                    <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td align="right">
	  

	  <input type="image" src="../../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('../product_menu.php',1);return false;"> 
        <input type="image" src="../../../images/bt_save.gif" width="76" height="22"> 



      </td>
                      </tr>
                    </table>
                  </form>
            <!--Content End-->
            <?
require($rela_path . "inc/footer.php");
?>
        